﻿USE DB_PNL
GO
---
DELETE FROM INVOICE
DELETE FROM INVOICE_OTHER
--DELETE FROM VOUCHER
--DELETE FROM VOUCHER_HISTORY
DELETE FROM CODE_TYPE WHERE GROUP_ID = 'SERV'
---
/****** Object:  Table [dbo].[VOUCHER]    Script Date: 10/18/2010 10:24:58 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[VOUCHER]') AND type in (N'U'))
DROP TABLE [dbo].[VOUCHER]

/****** Object:  Table [dbo].[VOUCHER]    Script Date: 10/18/2010 10:26:32 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[VOUCHER](
	[VOUCHER_NO] [varchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	[DATE_OF_VOUCHER] [datetime] NULL,
	[EMPLOYEE_ID] [varchar](10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[CUSTOMER_NAME_DIRECT] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[TICKET_NO] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[TRANSPORT_ID] [varchar](10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[SERVICE_ID] [varchar](10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[TOUR] [nvarchar](200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[REMARK] [nvarchar](200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[PROVIDER_ID] [varchar](10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[PROVIDER_PERSON_REPRESENT] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[BUY_TOTAL] [float] NULL,
	[BUY_VAT_PERCENT] [float] NULL,
	[BUY_VAT] [float] NULL,
	[BUY_SUM] [float] NULL,
	[BUY_CURRENCY] [varchar](10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[BUY_EXCHANGE] [float] NULL,
	[BUY_SUM_VND] [float] NULL,
	[CUSTOMER_ID] [varchar](10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[CUSTOMER_PERSON_REPRESENT] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[SALE_TOTAL] [float] NULL,
	[SALE_VAT_PERCENT] [float] NULL,
	[SALE_VAT] [float] NULL,
	[SALE_SUM] [float] NULL,
	[SALE_CURRENCY] [varchar](10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[SALE_EXCHANGE] [float] NULL,
	[SALE_SUM_VND] [float] NULL,
	[STATUS] [varchar](10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
 CONSTRAINT [PK_VOUCHER] PRIMARY KEY CLUSTERED 
(
	[VOUCHER_NO] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
---
INSERT INTO CODE_TYPE_GROUP (GROUP_ID, GROUP_NAME) VALUES ('TRANS', N'Hãng vận chuyển')
INSERT INTO CODE_TYPE (CODE_TYPE_ID, CODE_TYPE_NAME, GROUP_ID) VALUES ('TRANS_1', N'Vietnam Airline', 'TRANS')
INSERT INTO CODE_TYPE (CODE_TYPE_ID, CODE_TYPE_NAME, GROUP_ID) VALUES ('VSTATUS_8', N'Thu tiền đặt cọc', 'VSTATUS')

INSERT INTO CODE_TYPE (CODE_TYPE_ID, CODE_TYPE_NAME, GROUP_ID, FREE_FIELD1) VALUES ('SERV_1', N'Vé quốc tế', 'SERV', 'VMB')
INSERT INTO CODE_TYPE (CODE_TYPE_ID, CODE_TYPE_NAME, GROUP_ID, FREE_FIELD1) VALUES ('SERV_2', N'Vé quốc nội', 'SERV', 'VMB')
---